package com.shelpe.services.tenant.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shelpe.services.tenant.dao.AdgroupsMapper;
import com.shelpe.services.tenant.model.Adgroups;
import com.shelpe.services.tenant.model.AdgroupsExample;
import com.shelpe.services.tenant.service.AdgroupService;

@Service
public class AdgroupServiceImpl implements AdgroupService {
	
	private static final Logger logger = LoggerFactory.getLogger(AdgroupServiceImpl.class);
	
	@Autowired
	private AdgroupsMapper mapper;

	@Override
	public Adgroups getAdgroupsById(long adgroupId){
		
		return mapper.selectByPrimaryKey(adgroupId);
	}
	
	@Override
	public List<Adgroups> getAdgroupsByUserId(long userId){
		
		AdgroupsExample example = new AdgroupsExample();
		example.createCriteria().andUserIdEqualTo(userId);
		
		return mapper.selectByExample(example);
	}
}
